﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestClassLibrary
{
    public partial class frmbasicfun : Form
    {
        public frmbasicfun()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox1))
            {
                bool flag = BasicFunction.Class1.even(Convert.ToInt32(textBox1.Text));
                string result = flag ? "No is Even" : "No is Odd";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter No");
                textBox1.Focus();
            }
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox2))
            {
                bool flag = BasicFunction.Class1.primeno(Convert.ToInt32(textBox2.Text));
                string result = flag ? "Given no is prime" : "Given no is not prime";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a No");
                textBox2.Focus();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox3))
            {
                bool flag = BasicFunction.Class1.positiveno(Convert.ToInt32(textBox3.Text));
                string result=flag ? "Given no is positive" : "Given no is negatie";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox3.Focus();
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox4))
            {
                int revno = BasicFunction.Class1.reverseno(Convert.ToInt32(textBox4.Text));
                string result = Convert.ToInt32(textBox4.Text) == revno ? "Given no is Palidrom" : "Given No is not palidrom";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox4.Focus();
            }

        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox5))
            {
                int perno = BasicFunction.Class1.perfectno(Convert.ToInt32(textBox5.Text));
                string result = Convert.ToInt32(textBox5.Text) == perno ? "Given no is Perfacet" : "Given no is not perfect";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox5.Focus();
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox6))
            {
                int palno = BasicFunction.Class1.armstrno(Convert.ToInt32(textBox6.Text));
                string result = Convert.ToInt32(textBox6.Text) == palno ? "Given no is Armstrong" : "Given No is not Armstrong";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox6.Focus();
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox7))
            {
                bool flag = BasicFunction.Class1.divby2(Convert.ToInt32(textBox7.Text));
                string result = flag ? "Given No is Div By 2" : "Given No is Not Div By 2";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox7.Focus();
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox8))
            {
                bool flag = BasicFunction.Class1.divby3(Convert.ToInt32(textBox8.Text));
                string result = flag ? "Given No is Div By 3" : "Given No is Not Div By 3";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox8.Focus();
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox9))
            {
                bool flag = BasicFunction.Class1.divby4(Convert.ToInt32(textBox9.Text));
                string result = flag ? "Given No is Div By 4" : "Given No is Not Div By 4";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox9.Focus();
            }
        }

        private void button10_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox10))
            {
                bool flag = BasicFunction.Class1.divby5(Convert.ToInt32(textBox10.Text));
                string result = flag ? "Given No is Div By 5" : "Given No is Not Div By 5";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox10.Focus();
            }
        }

        private void button11_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox11))
            {
                bool flag = BasicFunction.Class1.divby2(Convert.ToInt32(textBox11.Text));
                bool flag1 = BasicFunction.Class1.divby3(Convert.ToInt32(textBox11.Text));
                string result = flag && flag1 ? "Given No is Div By 6" : "Given No is Not Div By 6";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox11.Focus();
            }
        }

        private void button12_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox12))
            {
                bool flag = BasicFunction.Class1.divby7(Convert.ToInt32(textBox12.Text));
                string result = flag ? "Given No is Div By 7" : "Given No is Not Div By 7";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox12.Focus();
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox13))
            {
                bool flag = BasicFunction.Class1.divby8(Convert.ToInt32(textBox13.Text));
                string result = flag ? "Given No is Div By 8" : "Given No is Not Div By 8";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox13.Focus();
            }
        }

        private void button14_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox14))
            {
                bool flag = BasicFunction.Class1.divby9(Convert.ToInt32(textBox14.Text));
                string result = flag ? "Given No is Div By 9" : "Given No is Not Div By 9";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox14.Focus();
            }
        }

        private void button15_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox15))
            {
                bool flag = BasicFunction.Class1.divby10(Convert.ToInt32(textBox15.Text));
                string result = flag ? "Given No is Div By 10" : "Given No is Not Div By 10";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox15.Focus();
            }
        }

        private void button16_Click(object sender, EventArgs e)
        {
            if (BasicFunction.Class1.isblank(textBox16))
            {
                bool flag = BasicFunction.Class1.divby11(textBox16.Text);
                string result = flag ? "Given No is Div By 11" : "Given No is Not Div By 11";
                MessageBox.Show(result);
            }
            else
            {
                MessageBox.Show("Enter a no");
                textBox16.Focus();
            }
        }
    }
}
